// var express = require('express');
// var router = express.Router();

// /* GET home page. */
// router.get('/', function(req, res, next) {
//   res.render('index', { title: '我是在routes下的index.js文件里面定义的标题' });
// });

// module.exports = router;

exports.index = function (req, res) {
  res.render('index',{title:'index标题'})
}
exports.about = function(req, res){
  res.render('about', { title: 'about的标题' });
};
exports.test = function(req, res){
  res.render('./test/test.html', { title: 'test的标题' });
};
exports.login = function(req, res){
  res.render('login', { title: '用户登陆'});
};
exports.doLogin = function(req, res){
  var user={
  username:'admin',
  password:'admin'
  }
  if(req.body.username===user.username && req.body.password===user.password){
    res.redirect('/home');
  }
    res.redirect('/login');
};
exports.logout = function(req, res){
  res.redirect('/');
};
exports.home = function(req, res){
  var user={
    username:'admin',
    password:'admin'
  }
  res.render('home', { title: 'Home页面',user: user});
};